<%@page import="java.util.ResourceBundle"%>
<%@page import="org.apache.naming.resources.Resource"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<div class="logo"> 
         <img class="foto" src="IMGS/music4me.png" />
        </div>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="CSS/estilo.css" media="all" />
    </head>
    <body>
        <c:if test="${not empty param.idioma}">
            <fmt:setLocale value="${param.idioma}" scope="session"/>
        </c:if>
       
      <div class="cabecalho">
        <a id="home" href="."><fmt:message key="system.home"/></a>
        <a id="cadastro" href="cadastro.jsp"><fmt:message key="system.registerTag"/></a>
      </div>
        
        
        <img class="foto" src="IMGS/fones.jpg" />  
        
        
        <div class="idioma">
          <%String params = request.getQueryString();
          Object url = request.getAttribute("realURI");
          if(url==null){
               url = request.getRequestURI();
          }else{
              url = (String) url;
          }
          
           if(params!=null){
              params = params.replaceAll("&idioma=(en|es|pt)", "");
           }else{
              params = "";
           }
          
          url = url+"?"+params;

            %>
          <a href="<%=url%>&idioma=pt">
              <img src="IMGS/Brazil-Flag-icon.png" >
          </a>
        <a href="<%=url%>&idioma=es">
            <img src="IMGS/Spain-Flag-icon.png" />
        </a>
        <a href="<%=url%>&idioma=en">
            <img src="IMGS/United-States-Flag-icon.png" />
        </a>
      </div>
    </body>
</html>